package com.pt5.pthouduan.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * Tracker 上报告的 Peer 信息表
 * </p>
 *
 * @author
 * @since 2025-05-06
 */
@TableName("torrent_peers")
public class TorrentPeer implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String infoHash;

    private String peerId;

    private Long userId;

    private String ip;

    private Integer port;

    private Long uploaded;

    private Long downloaded;

    private Long leftBytes;

    private String lastEvent;

    private LocalDateTime lastSeen;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getInfoHash() {
        return infoHash;
    }

    public void setInfoHash(String infoHash) {
        this.infoHash = infoHash;
    }

    public String getPeerId() {
        return peerId;
    }

    public void setPeerId(String peerId) {
        this.peerId = peerId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Long getUploaded() {
        return uploaded;
    }

    public void setUploaded(Long uploaded) {
        this.uploaded = uploaded;
    }

    public Long getDownloaded() {
        return downloaded;
    }

    public void setDownloaded(Long downloaded) {
        this.downloaded = downloaded;
    }

    public Long getLeftBytes() {
        return leftBytes;
    }

    public void setLeftBytes(Long leftBytes) {
        this.leftBytes = leftBytes;
    }

    public String getLastEvent() {
        return lastEvent;
    }

    public void setLastEvent(String lastEvent) {
        this.lastEvent = lastEvent;
    }

    public LocalDateTime getLastSeen() {
        return lastSeen;
    }

    public void setLastSeen(LocalDateTime lastSeen) {
        this.lastSeen = lastSeen;
    }

    @Override
    public String toString() {
        return "TorrentPeer{" +
                "id=" + id +
                ", infoHash='" + infoHash + '\'' +
                ", peerId='" + peerId + '\'' +
                ", userId=" + userId +
                ", ip='" + ip + '\'' +
                ", port=" + port +
                ", uploaded=" + uploaded +
                ", downloaded=" + downloaded +
                ", leftBytes=" + leftBytes +
                ", lastEvent='" + lastEvent + '\'' +
                ", lastSeen=" + lastSeen +
                '}';
    }
}
